import { observable, action, runInAction } from 'mobx';

class Order {
	@observable orders = {
		list: [],
	};

	@action async getOrderList() {
		let that = this;
		await fetch("http://zongwu.top/biaoguo-api/total_price/", {
			headers: {
				"Content-Type": "application/json",
			},
			method: "GET",

		}).then((response) => {
			return response.json();
		}).then((jsonData) => {
			that.orders.list = jsonData;
		}).catch((err) => {
			console.log(err);
		})

	}
}

const order = new Order();
export default order;